#include<stdio.h>
#include<math.h>
int countone(int n)
{
	int count=0;
	while(n!=0)
	{
		if(n%2==1)
		{
			count++;
		}
		n/=2;
	}
	return count;
}
int main ()
{
	int k,t;int x;
	scanf("%d",&t);
	int i,j;int count;
	for(k=1;k<=t;k++)
	{
		count=0;
		scanf("%d",&x);
//		printf("%d\n",countone(7));
		for(j=pow(2,x-1);j<=pow(2,x)-1;j++)
		{
			count+=countone(j);
		}
		printf("%d\n",count);
	}
	return 0;
}
